package org.simple.framework.data.jpa.entity;

import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.simple.framework.data.entity.Identifiable;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

/**
 * 项目名称：simple-framework
 * 类名称：PkUUID
 * 类描述：使用uuid的entity基类
 * 创建时间：2018/8/15
 *
 * @author sisyphus   (E-mail:1620657419@qq.com)
 * @version v1.0
 */
@Data
@MappedSuperclass
public abstract class UUIDEntity implements Identifiable<String> {

    @Id
    @Column(name = "ID", length = 64)
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    @GeneratedValue(generator = "system-uuid")
    protected String id;

}
